Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update cppcheck config to pass cleanly #3829

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

clumens
Copy link
Contributor

@clumens clumens commented Feb 17, 2025

@waltdisgrace Here's another simple one. My only concern here is that different versions of cppcheck may still require the older suppression messages. However, I don't think we mention anywhere what version of static analysis tools the pacemaker code is expected to pass with. Maybe we should specify that somewhere.

cppcheck runs just fine for me without these, though it's possible a
different version of cppcheck would still require them.
* -I is needed to find crmcommon_private.h for checking things in
  lib/common.

* --include is needed because otherwise it can't figure out where the
  definition of QB_XS comes from.  It seems like this shouldn't be
  necessary, but I haven't been able to figure out another way.
cppcheck doesn't understand the use of PCMK__VALGRIND_EXEC here, I think
because it's multiple strings concatenated together, and then wedged
inside a ternary operator.

In general I don't like rearranging code just to please static analysis,
but I don't really like how this code was arranged in the first place.
I think it's a little easier to follow duplicated like this.
With these, cppcheck passes cleanly.
@clumens
Copy link
Contributor Author

clumens commented Feb 18, 2025

Retest this please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant